package com.grm.workflow.controller;

import com.grm.common.entity.PageResult;
import com.grm.common.entity.Result;
import com.grm.workflow.request.my.todo.WfMyToDoQueryParam;
import com.grm.workflow.response.WfMyToDoResponse;
import com.grm.workflow.service.WfMyToDoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 我的待办
 */
@RestController
@RequestMapping("/workflow/my/todo")
public class WfMyToDoController {
    @Autowired
    private WfMyToDoService wfMyToDoService;

    @PostMapping("/list")
    public Result queryToDoSelective(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestBody WfMyToDoQueryParam queryParam) {
        // 开启分页
        PageResult<WfMyToDoResponse> pageResult = wfMyToDoService.querySelective(pageNum,pageSize,queryParam);
        return Result.success(pageResult.getData(),pageResult.getTotal());
    }

//    /**
//     * 审批
//     */
//    @PostMapping("/approve")
//    public Result approve(@RequestBody WfMyToDoApproveRequest request) {
//        // 开启分页
//        PageResult<WfMyApproveToDoResponse> pageResult = wfMyApproveToDoService.querySelective(pageNum,pageSize,queryParam);
//        return Result.success(pageResult.getData(),pageResult.getTotal());
//    }
}
